import cv2

url = "rtsp://admin:admin@192.168.31.173:8554/live"

print('start')
cap = cv2.VideoCapture(url)#读取视频流
while(cap.isOpened()):
    ret, frame = cap.read()
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()

